<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<form id="ligerForm" action="">
				<div class="fieldset1 tabel_col clearFix">
					<div class="caption">
						<span class="title">转仓申请</span>
					</div>
					<div class="fieldBox col_33">
						<div class="label">合同号</div>
						<div class="field">
							<a href="javascript:detailPrjBtn( ${prjbsc.id})">
								<font color="blue">	${prjbsc.lsCntNo}</font>
							</a>
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">项目类型</div>
						<div class="field">  ${prjbsc.prjTypCdNm} 
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">承租人</div>
						<div class="field">${switchvo.cstNm }</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">所属机构</div>
						<div class="field">${switchvo.buOrgCdNm}
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">省公司</div>
						<div class="field">${switchvo.cstMgrOrgCdPr }
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">分公司</div>
						<div class="field">${switchvo.cstMgrOrgCdCy }
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">是否资管业务</div>
						<div class="field">
							<c:if test="${ prjbsc.isInsBiz ==1}">是</c:if>
							<c:if test="${ prjbsc.isInsBiz !=1}">否</c:if>
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">第三方机构</div>
						<div class="field">
						<c:if test="${ prjbsc.isInsBiz ==1}">${prjbsc.fundRasInsNm}</c:if>
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">诉讼状态</div>
						<div class="field">${switchvo.suStatusNm}
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">总部档案编号</div>
						<div class="field">${switchvo.portfolioNumber}
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">省公司档案编号</div>
						<div class="field">${switchvo.portfolioNumberProvince}
						</div>
					</div>
					<div class="caption">
						<span class="title">权证转仓资料 </span>						
					</div>
					<div class="fieldBox col_33" style="display:none">
						<div class="label"></div>
						<div class="field">
						</div>
					</div>
					<c:forEach items="${list}" var="mgrvo">
					<div class="fieldBox col_100">
						
						<table style="BORDER-COLLAPSE: collapse;" borderColor=#ECECEC height=25 cellPadding=1 width="100%" align=center border=1> 
						<tr >
						<td >
						
						<font color="blue">${mgrvo.paylistCode}</font></a>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支付表状态：  ${mgrvo.payTStatusNm}&nbsp;&nbsp;&nbsp;  
						
						</td>
						</tr></table>
						<div style="width: 100%; ">
							 <table style="BORDER-COLLAPSE: collapse;margin-bottom:20px" borderColor=#ECECEC height=40 cellPadding=1 width="100%" align=center border=1> 
							<thead>
								<tr style="background:#E7FEF4">
									<th  style="text-align: center;width:5%;"></th>
									<th  style="text-align: center;width:10%">权证资料</th>
									<th  style="text-align: center;width:10%">资料类型</th>
									<th  style="text-align: center;width:10%">借出状态</th>
									<th  style="text-align: center;width:10%">归档地点（起）</th>									
									<th  style="text-align: center;width:10%">归档地点（终）</th>
									<th  style="text-align: center;width:10%">归档份数</th>
									<th  style="text-align: center;width:10%">转仓份数</th>
									<c:if test="${flag=='103' || flag=='104' || flag=='000'}">
										<th  style="text-align: center;width:10%">上架份数</th>
									</c:if> 
									<th  style="text-align: center;width:18%">扫描件</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${mgrvo.dlist}" var="item" varStatus="status">
									<tr>
									<td  style="text-align: center; height:20px;">${status.index+1}</td>
									<td  style="text-align: center; ">${item.fileName }</td>
									<td  style="text-align: center; ">${item.dossierTempNm }</td>
									<td  style="text-align: center; ">${item.borrowStatusNm }</td>
									<td  style="text-align: center; ">${item.placeBeginNm }</td>
									<td  style="text-align: center; ">
									<!-- 总部 省公司邮寄 -->
									<c:if test="${flag=='101' || flag=='102' || flag=='000'}">${item.placeEndNm }</c:if>
									<!-- 属地/总部 可修改归档终点 -->
									<c:if test="${flag=='103' || flag=='104'}">
										<c:if test="${item.isValid==1}">
										   <c:if test="${empty switchvo.portfolioNumberProvince}">
												<select name="placeEnd_${item.id}"  >
													<c:forEach items="${localList}" var="localCity"  >
														<c:if test="${localCity.key==item.placeEnd }"> 
															<option value="${localCity.key}" selected >${localCity.value }</option>
														</c:if>
														<c:if test="${localCity.key!=item.placeEnd }">  
															<option value="${localCity.key}"  >${localCity.value }</option>
														</c:if>
													</c:forEach>
												</select>
											</c:if>
											<c:if test="${not empty switchvo.portfolioNumberProvince}">${item.placeEndNm }</c:if>
										</c:if>
									</c:if>
									</td>
									<td  style="text-align: center; ">${item.dossierCountT }</td>
									<td  style="text-align: center; ">
									<c:if test="${flag=='101' || flag=='102'}">
									   <c:if test="${item.isValid==1}">
											<input value="${item.switchCount}" id="thisCount_c_code_${item.id}" name="thisCount_c_code_${item.id}"  type="text"   class="ui-textbox"  ligerui="width: 60" >
										</c:if>
										<c:if test="${item.isValid==0}"></c:if>
									</c:if> 
									<c:if test="${flag=='103' || flag=='104' || flag=='000'}">
										<c:if test="${item.isValid==1}">${item.switchCount }</c:if>
										<c:if test="${item.isValid==0}"></c:if>
										
									</c:if> 
									</td>
									<c:if test="${flag=='103' || flag=='104' || flag=='000'}">
										<td  style="text-align: center; ">
										    <c:if test="${item.isValid==1}">
											    <c:if test="${not empty item.switchCountSj}">
													<input  value="${item.switchCountSj}"   id="thisCountSj_c_code_${item.id}" name="thisCountSj_c_code_${item.id}"  type="text"  <c:if test="${flag=='000' }">readonly</c:if> class="ui-textbox"  ligerui="width: 60" >
												</c:if>
												<c:if test="${empty item.switchCountSj}">
													<input  value="${item.switchCount}"   id="thisCountSj_c_code_${item.id}" name="thisCountSj_c_code_${item.id}"  type="text" <c:if test="${flag=='000' }">readonly</c:if>  class="ui-textbox"  ligerui="width: 60" >
												</c:if>
											</c:if>
											<c:if test="${item.isValid==0}"></c:if>
										</td>
									</c:if> 
									<td  style="text-align: center; ">	
										<c:if test="${ item.filePath != null}">
				               			<a  target="_blank" href="${item.filePath }" >查看</a>
				               			</c:if>
											<c:forEach items="${item.ulFiles}" var="file" >
											<a  target="_blank" href="${file.filePath }" >查看</a>
											</c:forEach>	
											<div  class="upfiles" id="${item.id}" pkId="${item.eleId}"  style="text-align:left"></div>	
									</td>
									
								<tr>
								</c:forEach>
							</tbody>
						</table>
						</div>
						
					</div>
					</c:forEach>
					<!-- 邮寄信息 -->
					<div class="caption">
						<span class="title">邮寄信息</span>						
					</div>
					<c:if test="${flag=='101' || flag=='102' }"><!--总公司邮寄/省公司邮寄 可修改-->
						<jsp:include page="../arcMgr/arcPostAdd.jsp" flush="true" />
					</c:if>
					<jsp:include page="../arcSwitchMain/arcPostList.jsp" flush="true" />
					<!--邮寄 -->
					<!-- 隐藏参数 -->
	                <div class="fieldBox col_100" style="display:none;">
						<div class="field">
							<input type="text" id="pkId" name="pkId" value="${pkId}"><!--hidde date 发起流程data_id  -->
							<input type="text" id="flag" name="flag" value="${flag}"><!--hidde date 流程节点标识  -->
	                   		<input type="text" id="portfolioNumberProvince" value="${switchvo.portfolioNumberProvince}">
	                    </div>
	                </div>
				</div>
				<div class="btnsBox"  style="text-align:center">
						<c:if test="${flag!='000' }">
							<span id="saveBtn" class="sq-button sq-button-round"  onclick="save();">保存</span>
						</c:if>
				</div>
			</form>
		</div>
	</div>
	<jsp:include page="../../system/sysUlFilesRec/sysUlFileRecList2.jsp" flush="true" >
           
               <jsp:param name="fflag" value="0"/>
           
               <jsp:param name="tabNm" value="ARC_MGR_DETAIL"/>
    </jsp:include>
	<script type="text/javascript">
	 	
	 	
		var grid;
		
		$(function() {
			$("#ligerForm").ligerForm({
				validate: true
			});
			
			//initGrid();//初始化交接单明细
	    });
		
		
		//保存
		function save(){
			
			var ligerForm = liger.get("ligerForm");
			if (!ligerForm.valid()) {
				$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
				return false; 
			}
			var flag=$('#flag').val();
			if(flag=='101' || flag=='102'){//总部/省公司邮寄 校验邮寄信息
				if(!checkPost()){
					return ;
				}
			}
			//$("#saveBtn").attr("style","display:none;");
			var data = ligerForm.getData();//主表数据
			data["pkId"]=$('#pkId').val();
			data["flag"]=$('#flag').val();
			var wait_dialog = null;
			console.log(data);
			$.ajax({
				type: 'post',
				dataType: 'json',
				data: data,
				url: '<%=path%>/archive/arcSwitchMain/modifyFlow.do',
				beforeSend: function(){
					wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
				},success:function(msg){
					wait_dialog.close();
					window.location.reload();
					if(msg.success == 1){
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success",SQ_showButtons: true});
					}else{
						$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					}
				},error:function (XMLHttpRequest, textStatus, errorThrown) { 
					wait_dialog.close();
					$.ligerDialog.SQalert({content: "网络错误，请稍后重试",SQ_type: "error"});
				} 
			});
		}
		</script>
</body>
</html>